<?php
	// 获取传过来的值
	$user_phone = $_POST["user_phone"];
	$user_pass = $_POST["user_pass"];
	$mysql = new mysqli("localhost","root","","yihe");
	if($mysql -> connect_error){
		exit ("数据库链接失败,错误信息是{$mysql -> connect_error}");
	}else{
	//	echo "数据库连接成功";
	}
	//书写sql语句
	$select_sql = "select * from user_info where user_phone = '{$user_phone}'";
	$result = $mysql -> query($select_sql);
	if($result -> num_rows){
		if($result -> fetch_object() -> user_pass== $user_pass){
			// 用户名和密码输入正确
			echo "1";
		}else {
			// 密码输入错误
			echo "2";
		}
	}else if ($result -> num_rows == 0) {
		// 用户名不存在
		echo "3";
	}
?>